package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * 用户实体类
 */
@TableName("t_user")
@ApiModel(value = "用户实体类", description = "封装用户相关属性")
public class UserBean {
    /**
     * 用户编号
     */
    @TableId(value = "pk_userId", type = IdType.AUTO)
    @ApiModelProperty("用户编号")
    private Integer userId;
    /**
     * 用户账号
     */
    @TableField("u_userName")
    @ApiModelProperty("用户账号")
    private String userName;
    /**
     * 用户密码
     */
    @TableField("u_pwd")
    @ApiModelProperty("用户密码")
    private String pwd = "666";
    /**
     * 用户真实姓名
     */
    @TableField("u_relName")
    @ApiModelProperty("用户真实姓名")
    private String relName;
    /**
     * 角色集合
     */
    @TableField(exist = false)
    @ApiModelProperty("角色集合")
    private List<RoleBean> roleList;
    /**
     * 权限集合
     */
    @TableField(exist = false)
    @ApiModelProperty("权限集合")
    private List<GradeBean> gradeList;
    /**
     * 用户密码盐
     */
    @TableField("u_salt")
    @ApiModelProperty("用户密码盐")
    private String salt;

    public UserBean() {
    }

    public UserBean(String userName, String relName) {
        this.userName = userName;
        this.relName = relName;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }


    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getRelName() {
        return relName;
    }

    public void setRelName(String relName) {
        this.relName = relName;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", pwd='" + pwd + '\'' +
                ", relName='" + relName + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                ", salt='" + salt + '\'' +
                '}' + "\n";
    }
}
